From d892fc1b7f46275b1e5c291db0305eac83abe9e3 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 26 Dec 2007 22:26:13 +0000
Subject: koma-script update (25dec07)

git-svn-id: svn://tug.org/texlive/trunk@5924 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/koma-script/scrlttr2.cls  | 408 +++++++++++++++++----
 1 file changed, 344 insertions(+), 64 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls')

diff --git a/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls b/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls
index 5490047073d..b02516826bc 100644
--- a/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls
+++ b/Master/texmf-dist/tex/latex/koma-script/scrlttr2.cls
@@ -91,7 +91,7 @@
       \fi
     }
   \fi
-  \@CheckKOMAScriptVersion{2007/10/12 v2.97d KOMA-Script}%
+  \@CheckKOMAScriptVersion{2007/12/24 v2.98 KOMA-Script}%
 \endgroup
 \newcommand*{\KOMAClassName}{%
   scrlttr2%
@@ -142,7 +142,9 @@
 \@namedef{scr@v@2.97b}{3}
 \@namedef{scr@v@2.97c}{4}
 \@namedef{scr@v@2.97d}{5}
-\@namedef{scr@v@last}{5}
+\@namedef{scr@v@2.97e}{6}
+\@namedef{scr@v@2.98}{6}
+\@namedef{scr@v@last}{6}
 %%% From File: scrkmisc.dtx
 \KOMA@key{draft}[true]{%
   \KOMA@set@ifkey{draft}{@tempswa}{#1}%
@@ -237,16 +239,16 @@
   \ifstr{#3}{paper}{%
     \ifnumber{#2}{%
       \ifstr{#1}{a}{%
-        \PassOptionsToPackage{#1#2#3}{typearea}%
+        \PassOptionsToPackage{#3=#1#2}{typearea}%
       }{%
         \ifstr{#1}{b}{%
-          \PassOptionsToPackage{#1#2#3}{typearea}%
+          \PassOptionsToPackage{#3=#1#2}{typearea}%
         }{%
           \ifstr{#1}{c}{%
-            \PassOptionsToPackage{#1#2#3}{typearea}%
+            \PassOptionsToPackage{#3=#1#2}{typearea}%
           }{%
             \ifstr{#1}{d}{%
-              \PassOptionsToPackage{#1#2#3}{typearea}%
+              \PassOptionsToPackage{#3=#1#2}{typearea}%
             }{\scr@pti@nerr@r}%
           }%
         }%
@@ -259,6 +261,14 @@
 \newcommand*{\scr@pti@nerr@r}{
   \OptionNotUsed
 }
+\KOMA@key{twoside}[true]{%
+  \if@atdocument\else\PassOptionsToPackage{twoside=#1}{typearea}\fi%
+}
+\KOMA@DeclareObsoleteOption[\PackageInfoNoLine]{oneside}{twoside=false}
+\KOMA@key{twocolumn}[true]{%
+  \if@atdocument\else\PassOptionsToPackage{twoside=#1}{typearea}\fi%
+}
+\KOMA@DeclareObsoleteOption[\PackageInfoNoLine]{onecolumn}{twocolumn=false}
 \DeclareOption*{%
   \lco@test
   \x@paper}
@@ -434,12 +444,18 @@
 %%% From File: scrkftn.dtx
 %%% From File: scrklist.dtx
 %%% From File: scrknpap.dtx
+\KOMA@ifkey{firsthead}{@firsthead}\@firstheadtrue
 \newcommand*{\@alignfrom}{0}
-\KOMA@ncmdkey{fromalign}{@alignfrom}{%
-  {left}{0},%
-  {center}{1},{centered}{1},{middle}{1},%
-  {right}{2},%
-  {no}{10000},{false}{10000},{off}{10000}%
+\KOMA@key{fromalign}{%
+  \KOMA@set@ncmdkey{fromalign}{@alignfrom}{%
+    {left}{0},%
+    {center}{1},{centered}{1},{middle}{1},%
+    {right}{2},%
+    {locationleft}{3},{leftlocation}{3},%
+    {locationright}{4},{rightlocation}{4},{location}{4},%
+    {no}{10000},{false}{10000},{off}{10000}%
+  }{#1}%
+  \ifcase\@alignfrom\or\or\or\@firstheadfalse\or\@firstheadfalse\fi
 }
 \newcommand*{\@rulefrom}{0}
 \KOMA@ncmdkey{fromrule}[below]{@rulefrom}{%
@@ -497,7 +513,82 @@
 \DeclareOption{wlocfield}{\@ObsoleteOption{locfield=wide}}
 \DeclareOption{slocfield}{\@ObsoleteOption{locfield=narrow}}
 \newif\if@fold\@foldtrue
-\KOMA@ifkey{foldmarks}{@fold}
+\newcommand*{\@usefolds}{TMBPL}
+\KOMA@key{foldmarks}[true]{%
+  \begingroup
+    \def\KOMA@unknown@keyval##1##2##3{%
+      \def\sc@nf@ldch@rs####1{%
+        \ifx ####1\@nil\else
+          \if ####1T\g@addto@macro\@usefolds{####1}\else
+            \if ####1M\g@addto@macro\@usefolds{####1}\else
+              \if ####1B\g@addto@macro\@usefolds{####1}\else
+                \if ####1P\g@addto@macro\@usefolds{####1}\else
+                  \if ####1L\g@addto@macro\@usefolds{####1}\else
+                    \if ####1V\g@addto@macro\@usefolds{L}\else
+                      \if ####1H\g@addto@macro\@usefolds{TMBP}\else
+                        \if ####1t\scr@removechar\@usefolds{T}\else
+                          \if ####1m\scr@removechar\@usefolds{M}\else
+                            \if ####1b\scr@removechar\@usefolds{B}\else
+                              \if ####1p\scr@removechar\@usefolds{P}\else
+                                \if ####1l\scr@removechar\@usefolds{L}\else
+                                  \if ####1v%
+                                    \scr@removechar\@usefolds{L}%
+                                  \else
+                                    \if ####1h%
+                                      \scr@removechar\@usefolds{T}%
+                                      \scr@removechar\@usefolds{M}%
+                                      \scr@removechar\@usefolds{B}%
+                                    \else
+                                      \ClassError{\KOMAClassName}{%
+                                        unknown fold mark switch `####1'}{%
+                                        You should use option `foldmarks'
+                                        either with one of\MessageBreak
+                                        \@spaces `true', `on', or `yes' to
+                                        switch fold marks on,\MessageBreak
+                                        \@spaces `false', `off', or `no' to
+                                        switch fold marks off,\MessageBreak
+                                        or a combination of\MessageBreak
+                                        \@spaces `T', `M', `B', 'P', 'L', `V',
+                                        `H' to select dedicated fold
+                                        marks\MessageBreak
+                                        or\MessageBreak
+                                        \@spaces `t', `m', 'b', 'p', 'l', 'v',
+                                        'h' to deselect dedicated fold
+                                        marks.\MessageBreak
+                                        See the KOMA-Script manual for more
+                                        information.
+                                      }%
+                                    \fi
+                                  \fi
+                                \fi
+                              \fi
+                            \fi
+                          \fi
+                        \fi
+                      \fi
+                    \fi
+                  \fi
+                \fi
+              \fi
+            \fi
+          \fi
+          \expandafter\sc@nf@ldch@rs
+        \fi
+      }%
+      \expandafter\sc@nf@ldch@rs#1\@nil
+    }%
+    \KOMA@set@ifkey\@empty{@fold}{#1}%
+    \if@fold\aftergroup\@foldtrue\else\aftergroup\@foldfalse\fi
+  \endgroup
+}
+\newcommand*{\scr@removechar}[2]{%
+  \def\in@@##1#2##2##3\in@@{%
+    \ifx\in@##2\else
+      \def\in@@####1#2\in@{\gdef#1{##1####1}}%
+      \in@@##2##3%
+    \fi}%
+  \expandafter\in@@#1#2\in@\in@@
+}
 \newif\if@refwide
 \KOMA@key{refline}[wide]{%
   \begingroup
@@ -546,6 +637,7 @@
   \endgroup
 }
 \KOMA@ifkey{enlargefirstpage}{@enlargefp}
+\KOMA@ifkey{firstfoot}{@firstfoot}\@firstfoottrue
 \newcommand*{\@pageat}{4}
 \KOMA@key{pagenumber}{%
   \begingroup
@@ -1911,7 +2003,7 @@
 \aliaskomafont{pagination}{pagenumber}
 \newcommand*{\scr@fnt@pagehead}{\headfont}
 \newcommand*{\scr@fnt@wrn@pagehead}[1]{%
-  `pagehead' and `pagefoot' are aliases for the same^^b8\MessageBreak
+  `pagehead' and `pagefoot' are aliases for the same\MessageBreak
   font element, changed%
 }
 \aliaskomafont{pagefoot}{pagehead}
@@ -2322,8 +2414,16 @@
 \newkomafont{title}{\normalcolor\sffamily\bfseries}
 \newkomafont{subject}{\normalcolor\bfseries}
 \@newplength{foldmarkhpos}
+\@newplength{foldmarkvpos}
 \@newplength{tfoldmarkvpos}
+\@newplength{mfoldmarkvpos}
 \@newplength{bfoldmarkvpos}
+\@newplength{lfoldmarkhpos}
+\@newplength{pfoldmarklength}
+\@newplength{tfoldmarklength}
+\@newplength{mfoldmarklength}
+\@newplength{bfoldmarklength}
+\@newplength{lfoldmarklength}
 \@newplength{foldmarkthickness}
 \@setplength{foldmarkthickness}{.2pt}
 \@newplength{toaddrvpos}
@@ -2334,7 +2434,10 @@
 \@newplength{toaddrindent}
 \@newplength{toaddrwidth}
 \@newplength{toaddrheight}
+\@newplength{locvpos}
 \@newplength{locwidth}
+\@newplength{lochpos}
+\@newplength{locheight}
 \@newplength{refvpos}
 \@newplength{refwidth}
 \@newplength{refhpos}
@@ -2376,7 +2479,7 @@
   \ifodd\value{page}\hskip \oddsidemargin\else\hskip \evensidemargin\fi%
   \ignorespaces%
 }
-\newcommand*{\vb@t@z}[1]{{%
+\newcommand{\vb@t@z}[1]{{%
     \setbox0\vbox to\z@{#1\vss}%
     \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative
     \setlength{\baselineskip}{\z@}%
@@ -2391,15 +2494,83 @@
     \rlap{\move@topl\hskip\useplength{foldmarkhpos}%
       \usekomafont{foldmark}{%
         \rule{#2}{\useplength{foldmarkthickness}}}}}%
-  \ignorespaces%
+  \ignorespaces
+}
+\newcommand*{\@hfoldmark}[1]{%
+  \begingroup
+    \@expandtwoargs\in@{#1}{\@usefolds}%
+    \ifin@
+      \lowercase{%
+        \edef\@tempa{%
+          \noexpand\ifdim \noexpand\useplength{#1foldmarkvpos}=\noexpand\z@
+          \noexpand\else
+            \noexpand\@foldmark{%
+              \noexpand\useplength{#1foldmarkvpos}%
+            }{%
+              \noexpand\useplength{#1foldmarklength}%
+            }%
+          \noexpand\fi
+        }%
+      }%
+      \@tempa
+    \fi
+  \endgroup
+}
+\newcommand*{\@vfoldmark}[1]{%
+  \begingroup
+    \@expandtwoargs\in@{#1}{\@usefolds}%
+    \ifin@
+      \ifdim \useplength{lfoldmarkhpos}=\z@\else
+        \vb@t@z{%
+          \ifdim \useplength{foldmarkvpos}<\z@
+            \nobreak\vskip \paperheight\nobreak
+          \fi
+          \vskip \useplength{foldmarkvpos}%
+          \vskip \useplength{foldmarkthickness}%
+          \rlap{\move@topl
+            \setlength{\@tempdima}{\useplength{lfoldmarkhpos}}%
+            \addtolengthplength[-.5]{\@tempdima}{foldmarkthickness}%
+            \hskip\@tempdima
+            \usekomafont{foldmark}{%
+              \rule{\useplength{foldmarkthickness}}%
+                   {\useplength{lfoldmarklength}}%
+            }%
+          }%
+        }%
+        \ignorespaces
+      \fi
+    \fi
+  \endgroup
 }
 \newcommand*{\@foldmarks}{%
   \if@fold%
     \typeout{Foldmarks: yes}%
     \move@topt
-    \@foldmark{\useplength{tfoldmarkvpos}}{2mm}%
-    \@foldmark{.5\paperheight}{4mm}%
-    \@foldmark{\useplength{bfoldmarkvpos}}{2mm}%
+    \ifdim \useplength{pfoldmarklength}=\z@
+      \@setplength{pfoldmarklength}{4mm}%
+    \fi
+    \ifdim \useplength{tfoldmarklength}=\z@
+      \@setplength{tfoldmarklength}{2mm}%
+    \fi
+    \ifdim \useplength{mfoldmarklength}=\z@
+      \@setplength{mfoldmarklength}{2mm}%
+    \fi
+    \ifdim \useplength{bfoldmarklength}=\z@
+      \@setplength{bfoldmarklength}{2mm}%
+    \fi
+    \ifdim \useplength{lfoldmarklength}=\z@
+      \@setplength{lfoldmarklength}{4mm}%
+    \fi
+    \begingroup
+      \@expandtwoargs\in@{P}{\@usefolds}%
+      \ifin@
+        \@foldmark{.5\paperheight}{\useplength{pfoldmarklength}}%
+      \fi
+    \endgroup
+    \@hfoldmark{T}%
+    \@hfoldmark{M}%
+    \@hfoldmark{B}%
+    \@vfoldmark{L}%
     \move@frompt
   \else
     \typeout{Foldmarks: no}%
@@ -2430,40 +2601,48 @@
   \endgroup%
 }
 \newcommand*{\@firstheadfootfield}{%
-  \typeout{Head of first page}%
-  \move@topt\vskip\useplength{firstheadvpos}%
-  \vb@t@z{%
-    \rlap{\move@topl
-      \setlength\@tempskipa{.5\paperwidth}%
-      \addtolengthplength[-.5]{\@tempskipa}{firstheadwidth}%
-      \hskip\@tempskipa
-      \vbox{\hsize\useplength{firstheadwidth}%
-        \setlength{\@tempskipa}{\useplength{toaddrvpos}}%
-        \addtolengthplength[-1]{\@tempskipa}{firstheadvpos}%
-        \addtolength{\@tempskipa}{-\baselineskip}%
-        \setlength{\textwidth}{\useplength{firstheadwidth}}%
-        \setlength{\parfillskip}{\z@ \@plus 1fil}%
-        \@savevbox{\@tempskipa}{\@firsthead\vskip \z@ \@plus .00001fil}%
-        {head of first page}{firstheadvpos}{\firsthead}%
+  \if@firsthead
+    \typeout{Head of first page}%
+    \move@topt\vskip\useplength{firstheadvpos}%
+    \vb@t@z{%
+      \rlap{\move@topl
+        \setlength\@tempskipa{.5\paperwidth}%
+        \addtolengthplength[-.5]{\@tempskipa}{firstheadwidth}%
+        \hskip\@tempskipa
+        \vbox{\hsize\useplength{firstheadwidth}%
+          \setlength{\@tempskipa}{\useplength{toaddrvpos}}%
+          \addtolengthplength[-1]{\@tempskipa}{firstheadvpos}%
+          \addtolength{\@tempskipa}{-\baselineskip}%
+          \setlength{\textwidth}{\useplength{firstheadwidth}}%
+          \setlength{\parfillskip}{\z@ \@plus 1fil}%
+          \@savevbox{\@tempskipa}{\@firsthead\vskip \z@ \@plus .00001fil}%
+          {head of first page}{firstheadvpos}{\firsthead}%
+        }%
       }%
     }%
-  }%
-  \vskip-\useplength{firstheadvpos}\move@frompt
-  \typeout{Foot of first page}%
+    \vskip-\useplength{firstheadvpos}\move@frompt
+  \else
+    \typeout{No head at first page}%
+  \fi
   \move@topt
-  \vb@t@z{%
-    \rlap{\move@topl
-      \setlength\@tempskipa{.5\paperwidth}%
-      \addtolengthplength[-.5]{\@tempskipa}{firstfootwidth}%
-      \hskip\@tempskipa%
-      \vbox{\hsize\useplength{firstfootwidth}%
-        \vskip\useplength{firstfootvpos}%
-        \setlength{\textwidth}{\useplength{firstfootwidth}}%
-        \setlength{\parfillskip}{\z@ \@plus 1fil}%
-        \vbox{\hsize\useplength{firstfootwidth}\@firstfoot}%
+  \if@firstfoot
+    \typeout{Foot of first page}%
+    \vb@t@z{%
+      \rlap{\move@topl
+        \setlength\@tempskipa{.5\paperwidth}%
+        \addtolengthplength[-.5]{\@tempskipa}{firstfootwidth}%
+        \hskip\@tempskipa%
+        \vbox{\hsize\useplength{firstfootwidth}%
+          \vskip\useplength{firstfootvpos}%
+          \setlength{\textwidth}{\useplength{firstfootwidth}}%
+          \setlength{\parfillskip}{\z@ \@plus 1fil}%
+          \vbox{\hsize\useplength{firstfootwidth}\@firstfoot}%
+        }%
       }%
     }%
-  }%
+  \else
+    \typeout{No foot at first page}%
+  \fi
   \move@frompt%
   {%
     \setlength{\@tempdima}{1in}\addtolength{\@tempdima}{\topmargin}%
@@ -2471,7 +2650,11 @@
     \addtolength{\@tempdima}{\headsep}%
     \addtolength{\@tempdima}{\textheight}%
     \addtolength{\@tempdima}{\footskip}%
-    \addtolengthplength[-1]{\@tempdima}{firstfootvpos}%
+    \if@firstfoot
+      \addtolengthplength[-1]{\@tempdima}{firstfootvpos}%
+    \else
+      \addtolength{\@tempdima}{-\paperheight}%
+    \fi
     \ifdim\@tempdima>\z@\enlargethispage{-\@tempdima}%
     \else\if@enlargefp\enlargethispage{-\@tempdima}\fi\fi
   }%
@@ -2558,43 +2741,140 @@
       \@setplength[.5]{locwidth}{\useplength{locwidth}}%
     \fi%
   \fi%
-  \ifnum 1=\@alignfrom
+  \ifcase\@alignfrom
+  \or
     \if@logo
-      \ifkomavarempty{location}{%
-        \setkomavar{location}{\null}}{}%
+      \ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
     \fi
+  \or
+  \or
+    \ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
+  \or
+    \ifkomavarempty{location}{\setkomavar{location}{\null}}{}%
   \fi
   \ifkomavarempty{location}{%
     \typeout{Location field: empty}%
     }{%
     \typeout{Location field: yes}%
-    \move@topt\vskip\useplength{toaddrvpos}%
-    \vb@t@z{\rlap{%
+    \ifdim \useplength{lochpos}=\z@%
+      \@setplength{lochpos}{\useplength{toaddrhpos}}%
+    \fi
+    \ifdim \useplength{locvpos}=\z@%
+      \@setplength{locvpos}{\useplength{toaddrvpos}}%
+    \fi
+    \ifdim \useplength{locheight}=\z@%
+      \@setplength{locheight}{\useplength{toaddrheight}}%
+      \@addtoplength{locheight}{\useplength{backaddrheight}}%
+    \fi
+    \move@topt\vskip\useplength{locvpos}%
+    \vb@t@z{\noindent\makebox[0pt][l]{%
         \move@topl
-        \setlengthtoplength[-]{\@tempskipa}{toaddrhpos}%
+        \setlengthtoplength[-]{\@tempskipa}{lochpos}%
         \ifdim \@tempskipa<\z@
           \addtolength{\@tempskipa}{\paperwidth}%
         \else
           \addtolengthplength{\@tempskipa}{locwidth}%
         \fi
         \hskip\@tempskipa
-        \llap{%
-          \@savevbox{\useplength{toaddrheight}}{%
+        \makebox[0pt][r]{%
+          \@savevbox{\useplength{locheight}}{%
             \noindent\hsize\useplength{locwidth}%
-            \ifnum 1=\@alignfrom
+            \ifcase\@alignfrom
+              \usekomavar{location}%
+            \or
               \if@logo
-                \ifkomavarempty{fromlogo}{}{%
+                \ifkomavarempty{fromlogo}{\null}{%
                   {\raggedleft\noindent\usekomavar{fromlogo}\\
                     \vskip\parskip}\noindent}%
               \fi
+            \or
+              \usekomavar{location}%
+            \or
+              \if@logo
+                \ifkomavarempty{fromlogo}{}{%
+                  \raggedleft\usekomavar{fromlogo}\par}%
+              \fi
+              \raggedright
+              {\usekomafont{fromname}\strut\ignorespaces
+                \usekomavar{fromname}%
+                {%
+                  \ifnum\@rulefrom=1\\[-.5\baselineskip]%
+                    \usekomafont{fromrule}{%
+                      \setlength{\@tempdima}{\useplength{fromrulewidth}}%
+                      \ifdim\@tempdima=\z@
+                        \setlength{\@tempdima}{\useplength{locwidth}}%
+                      \fi
+                      \expandafter\rule\expandafter{\the\@tempdima}{%
+                        \useplength{fromrulethickness}}%
+                    }%
+                  \fi
+                }%
+                \\
+              }%
+              {\usekomafont{fromaddress}\strut\ignorespaces
+                \usekomavar{fromaddress}%
+                \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
+                \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
+                \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
+                \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
+                \ifnum\@rulefrom=2\\[-.5\baselineskip]%
+                  \usekomafont{fromrule}{%
+                    \setlength{\@tempdima}{\useplength{fromrulewidth}}%
+                    \ifdim\@tempdima=\z@
+                      \setlength{\@tempdima}{\useplength{locwidth}}%
+                    \fi
+                    \expandafter\rule\expandafter{\the\@tempdima}{%
+                      \useplength{fromrulethickness}}}%
+                \fi
+                \\
+              }%
+            \or
+              \raggedleft
+              \if@logo
+                \ifkomavarempty{fromlogo}{}{\usekomavar{fromlogo}\par}%
+              \fi
+              {\usekomafont{fromname}\strut\ignorespaces
+                \usekomavar{fromname}%
+                {%
+                  \ifnum\@rulefrom=1\\[-.5\baselineskip]%
+                    \usekomafont{fromrule}{%
+                      \setlength{\@tempdima}{\useplength{fromrulewidth}}%
+                      \ifdim\@tempdima=\z@
+                        \setlength{\@tempdima}{\useplength{locwidth}}%
+                      \fi
+                      \expandafter\rule\expandafter{\the\@tempdima}{%
+                        \useplength{fromrulethickness}}%
+                    }%
+                  \fi
+                }%
+                \\
+              }%
+              {\usekomafont{fromaddress}\strut\ignorespaces
+                \usekomavar{fromaddress}%
+                \if@phone\\\usekomavar*{fromphone}\usekomavar{fromphone}\fi%
+                \if@fax\\\usekomavar*{fromfax}\usekomavar{fromfax}\fi%
+                \if@email\\\usekomavar*{fromemail}\usekomavar{fromemail}\fi%
+                \if@www\\\usekomavar*{fromurl}\usekomavar{fromurl}\fi%
+                \ifnum\@rulefrom=2\\[-.5\baselineskip]%
+                  \usekomafont{fromrule}{%
+                    \setlength{\@tempdima}{\useplength{fromrulewidth}}%
+                    \ifdim\@tempdima=\z@
+                      \setlength{\@tempdima}{\useplength{locwidth}}%
+                    \fi
+                    \expandafter\rule\expandafter{\the\@tempdima}{%
+                      \useplength{fromrulethickness}}}%
+                \fi
+                \\
+              }%
+              \usekomavar{location}%
             \fi
-            \usekomavar{location}\vskip \z@ \@plus .00001fil}%
-          {location field}{toaddrheight}{\setkomavar}%
-          }}%
-      }%
-    \vskip-\useplength{toaddrvpos}\move@frompt
+            \vskip \z@ \@plus .00001fil}%
+          {location field}{locheight}{\setkomavar}%
+        }}%
     }%
-  }
+    \vskip-\useplength{locvpos}\move@frompt
+  }%
+}
 \newcommand*{\@set@reffield}[1]{%
   \ifkomavarempty{#1}{}{%
     \settowidth{\@tempdima}{\strut\usekomafont{refvalue}\usekomavar{#1}}%
-- 
cgit v1.2.3

