if (password == null)
{
successful = false; // "Cancel" was pressed
return;
}
EncryptedWriter encryptedWriter = new EncryptedWriter(new XmlWriter());
encryptedWriter.setPassword(password);
writer = encryptedWriter;
document.setPassword(password);
}
else
writer = new TreepadWriter(encoding);