avoid negative offsets to OUString::copy

Change-Id: I0a62f8a38694a4a7662fe376aaabc35dca817d33
fix caption dialog

Change-Id: I499f47b116ff6957bbbc20b91224fe95593d1da1